import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag === 'emoji-picker'
        }
      }
    })],
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src') // 这里配置了 @ 指向 src 目录
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://192.168.6.102:8889',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }
  },
  build: {
    outDir: 'dist'
  }
})
